package com.example.xinli.model;

import java.util.ArrayList;
import java.util.List;

public class Post {
    private String id;
    private String username;
    private String nickname;
    private String content;
    private String imageUrl;
    private long timestamp;
    private int likeCount;
    private List<Comment> comments;
    private boolean isLiked;

    public Post() {
        // 默认构造函数
        this.comments = new ArrayList<>();
    }

    public Post(String id, String username, String nickname, String content, String imageUrl, long timestamp) {
        this.id = id;
        this.username = username;
        this.nickname = nickname;
        this.content = content;
        this.imageUrl = imageUrl;
        this.timestamp = timestamp;
        this.likeCount = 0;
        this.comments = new ArrayList<>();
        this.isLiked = false;
    }

    // Getters and Setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public int getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(int likeCount) {
        this.likeCount = likeCount;
    }

    public List<Comment> getComments() {
        return comments;
    }

    public void setComments(List<Comment> comments) {
        this.comments = comments;
    }

    public boolean isLiked() {
        return isLiked;
    }

    public void setLiked(boolean liked) {
        isLiked = liked;
    }
}
